{include file="public/header" /}
<blockquote class="layui-elem-quote">
    数据库字段添加
</blockquote>
<form class="layui-form layui-form-pane kllxs-form" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">字段名</label>
        <div class="layui-input-block">
            <input type="text" name="field" autocomplete="off" placeholder="请输入字段名" class="layui-input" value="">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <select name="type">
                <option value="">请选择类型</option>
                {foreach $mysqlType as $k=>$v}
                <option value="{$v}">{$v}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">类型长度</label>
        <div class="layui-input-block">
            <input type="text" name="limit" autocomplete="off" placeholder="请输入类型长度,长度区间用英文逗号,分割" class="layui-input"
                value="">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">默认值</label>
        <div class="layui-input-block">
            <input type="text" name="default" autocomplete="off" placeholder="请输入默认值" class="layui-input" value="">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input type="text" name="comment" autocomplete="off" placeholder="请输入备注" class="layui-input" value="">
        </div>
    </div>

    <div class="layui-form-item">
        <button class="layui-btn" lay-submit lay-filter="kllxs-submit">确认</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{include file="public/footer" /}
<script>

    layui.use(["form", "popup"], function () {
        var form = layui.form;
        var popup = layui.popup;

        form.on('submit(kllxs-submit)', function (data) {
            var field = data.field; // 获取表单全部字段值

            popup.formSubmit("", field)

            return false; // 阻止默认 form 跳转
        })
    })
</script>